<!DOCTYPE html>
<html>
<head>
    <title>统计查询</title>
        <link rel="stylesheet" href="$gqt/admin/css/layui.css">
    <script src="http://lib.sinaapp.com/js/jquery/1.4.2/jquery.min.js"></script>
    <script src="/GQT/public/static/admin/js/layui.js"></script>
</head>
<style type="text/css">
/*#search{    margin-top: 0%;}
#display{
    margin-top: 0px;
    border-bottom-width: 100%;
    margin-bottom: 0px;
    border-top-width: 3%;
    height: 1200px;
    width: 100%;
}*/
</style>
<body>
<div id="search">
<form action="" method="post" class="layui-form">
     <div class="layui-form-item">
    <label class="layui-form-label">系别</label>
    <div class="layui-input-block">
      <select name="dept" >
        <option value=""></option>
        <option value="地震科学系">地震科学系</option>
        <option value="防灾工程系">防灾工程系</option>
        <option value="防灾仪器系">防灾仪器系</option>
        <option value="灾害信息工程系">灾害信息工程系</option>
        <option value="经济管理系">经济管理系</option>
        <option value="人文社科系">人文社科系</option>
        <option value="外语系">外语系</option>
      </select>
    </div>
  </div>
    <div class="layui-form-item">
        <label class="layui-form-label">专业</label>
        <div class="layui-input-block">
        <input type="text" name="major"  placeholder="请输入账号" autocomplete="off" class="layui-input" >
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">班级</label>
        <div class="layui-input-block">
        <input type="text" name="class"  placeholder="请输入账号" autocomplete="off" class="layui-input" onkeyup="value=value.replace(/[^\d]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">学号</label>
        <div class="layui-input-block">
        <input type="text" name="stu_id" placeholder="请输入账号" autocomplete="off" class="layui-input" onkeyup="value=value.replace(/[^\d]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))">
        </div>
    </div>
     <div class="layui-form-item">
                        <div class="layui-input-block">
                            <button class="layui-btn" lay-submit lay-filter="formDemo" type="submit">立即提交</button>
                            <!-- <button class="layui-btn"  lay-filter="formDemo" type="submit">立即提交</button> -->
                            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                        </div>
                    </div>
</form>
</div>
<div id="display">
<table class="layui-table" lay-size="sm">
       <thead>
           <tr>学号</tr>
           <tr>姓名</tr>
           <tr>系别</tr>
           <tr>班级</tr>
           <tr>德</tr>
           <tr>智</tr>
           <tr>体</tr>
           <tr>其他</tr>
           <tr>项目学分</tr>
       </thead>
       <tbody>
       {volist name="list" id="vo"}
           <tr>{$vo.stu_id}</tr>
           <tr>{$vo.name}</tr>
           <tr>{$vo.dept}</tr>
           <tr>{$vo.class}</tr>
           <tr>{$vo.virture}</tr>
           <tr>{$vo.wit}</tr>
           <tr>{$vo.sport}</tr>
           <tr>{$vo.other_score}</tr>
           <tr>{$vo.pro_score}</tr>
       </tbody>
       {/volist}
   </table> 
<!--    <table id="demo" lay-filter="test"></table> -->
</div>
</body>
<script type="text/javascript">
     layui.use('form', function () {
            var form = layui.form;
            //监听提交
            form.on('submit(formDemo)', function (data1) {
                //console.log(data1.field);
                layer.msg(JSON.stringify(data1.field));
                // var a=JSON.stringify(data1.field);
                $.ajax({
                type: "post",
                url: "score_select",
                data:data1.field,
                datatype: "application/text",
                success: function (data) {
                    console.log(1);
                        if (data) {
                        alert("添加成功");
                        };
                        if (!data) {alert("添加失败！该用户已存在！")};
                    }
                });
                return false;
            });
        });
// layui.use('table', function(){
//   var table = layui.table;
  
//   //第一个实例
//   table.render({
//     elem: '#demo'
//     ,height: 315
//     ,url: 'pro_data' //数据接口
//     ,page: true //开启分页
//     ,limit: 10 //每页默认显示的数量
//     ,response: {
//   statusName: 'code' //数据状态的字段名称，默认：code
//   ,statusCode: 0 //成功的状态码，默认：0
//   ,msgName: 'msg' //状态信息的字段名称，默认：msg
//   ,countName: 'count' //数据总数的字段名称，默认：count
//   ,dataName: 'data' //数据列表的字段名称，默认：data
// }  
//     ,cols: [[ //表头
//       {field: 'stu_id', title: '学号', width:80, sort: true, fixed: 'left'}
//       ,{field: 'name', title: '姓名', width:80}
//       ,{field: 'class', title: '班级', width: 177}
//       ,{field: 'sex', title: '性别', width:80}
//        ,{field: 'grade', title: '年级', width: 80, sort: true}
//        ,{field: 'dept', title: '系别', width: 80, sort: true}
//        ,{field: 'major', title: '系别', width: 80, sort: true}
//       // ,{field: 'score', title: '学分', width:80 , sort: true} 
//      ,{field: 'pro_score', title: '项目学分', width: 135, sort: true}
//     ]],

//       done: function (res, curr, count) {
//                     //如果是异步请求数据方式，res即为你接口返回的信息。
//                     //如果是直接赋值的方式，res即为：{data: [], count: 99} data为当前页数据、count为数据总长度
//                     console.log(res);

//                     //得到当前页码
//                     console.log(curr);

//                     //得到数据总量
//                     console.log(count);
//                 }
//   });
  
// });
</script>
</html>
<!-- {"code":0,"msg":"","count":1000,"data":[
{"stu_id":165042120,"name":"\u738b\u5fd7\u5764","class":1650421,"sex":"\u7537","grade":2,"dept":"123","major":"12","score":60,"pro_score":12},
{"stu_id":165042101,"name":"\u5d14\u5fd7\u5706","class":1650421,"sex":"\u7537","grade":2,"dept":"11","major":"1","score":60,"pro_score":11},
{"stu_id":16042119,"name":"\u80e1\u660c\u79c0","class":1650421,"sex":"\u7537","grade":2,"dept":"\u707e\u5bb3\u4fe1\u606f\u5de5\u7a0b\u7cfb","major":"\u8ba1\u7b97\u673a\u79d1\u5b66\u4e0e\u6280\u672f","score":100,"pro_score":100}
]} -->